<template>
	<view>
		{{count}}
		{{str}}
		<button @click="addcount(2)">add1</button>
		<button @click="getmsg">add2</button>
		<button @click="pay">支付</button>
	</view>
</template>

<script>
import {mapState,mapMutations,mapActions} from 'vuex'
export default {
	data(){
		return{
		}
	},
	methods:{
		...mapMutations('demo1',['addcount']),
		...mapActions('demo1',['getmsg']),
		pay(){
			uni.login({
				success(res) {
					console.log(res);
				}
			})
		}
	},
	computed:{
		...mapState(
		'demo1',
			{
				count:(state)=>state.count,
				str:(state)=>state.str,
				}
		)
	}
}
</script>

<style>
	
	
</style>
